﻿partial struct EntitasIntVec3
{
    public int x;
    public int y;
    public int z;
    public static EntitasIntVec3 Zero { get { return new EntitasIntVec3(0, 0, 0); } private set { } }


    public EntitasIntVec3(int y, int x)
    {
        this.x = x;
        this.y = y;
        z = 0;
    }

    public EntitasIntVec3(int x, int y, int z)
    {
        this.x = x;
        this.y = y;
        this.z = z;
    }



    public void Setvector(int Newx, int NewY, int NewZ)
    {
        x = Newx;
        y = NewY;
        z = NewZ;
    }

    public override bool Equals(object obj)
    {
        if (obj is EntitasIntVec3)
        {
            EntitasIntVec3 vec = (EntitasIntVec3)obj;
            if (vec == this)
                return true;
            else return false;
        }
        else return false;
    }

    public override string ToString()
    {
        return ("X=" + x + " Y=" + y + " Z=" + z);
    }
    public override int GetHashCode()
    {
        var hashCode = 373119288;
        hashCode = hashCode * -1521134295 + base.GetHashCode();
        hashCode = hashCode * -1521134295 + x.GetHashCode();
        hashCode = hashCode * -1521134295 + y.GetHashCode();
        hashCode = hashCode * -1521134295 + z.GetHashCode();
        return hashCode;
    }

    public static bool operator ==(EntitasIntVec3 a, EntitasIntVec3 b)
    {
        if (a.x == b.x && a.y == b.y && a.z == b.z)
            return true;
        else return false;
    }

    public static bool operator !=(EntitasIntVec3 a, EntitasIntVec3 b)
    {
        if (a.x != b.x || a.y != b.y || a.z != b.z)
            return true;
        else return false;
    }

    public static EntitasIntVec3 operator +(EntitasIntVec3 a, EntitasIntVec3 b)
    {
        var sum = new EntitasIntVec3
        {
            x = a.x + b.x,
            y = a.y + b.y,
            z = a.z + b.z
        };
        return sum;
    }

    public static EntitasIntVec3 operator -(EntitasIntVec3 a, EntitasIntVec3 b)
    {
        var difference = new EntitasIntVec3
        {
            x = a.x - b.x,
            y = a.y - b.y,
            z = a.z - b.z
        };
        return difference;
    }

    public static EntitasIntVec3 operator *(EntitasIntVec3 a, int value)
    {
        a.x *= value;
        a.y *= value;
        a.z *= value;
        return a;
    }

    public static EntitasIntVec3 operator /(EntitasIntVec3 a, int value)
    {
        a.x /= value;
        a.y /= value;
        a.z /= value;
        return a;
    }
}

